Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QPACK security considerations #3575

Merged
merged 5 commits into from May 6, 2020
Merged

QPACK security considerations #3575

merged 5 commits into from May 6, 2020

Conversation

afrind
Copy link
Contributor

@afrind afrind commented Apr 13, 2020

Behold

Fixes #1737

Behold

Fixes: 1737
@ianswett ianswett requested a review from bencebeky April 13, 2020 22:15
Copy link
Member

@martinthomson martinthomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. But then I'm not impartial in this.

An informative reference to HPACK might be wise. Otherwise people might get an unexplained sense of déjà vu.


Note:

Padding schemes only provide limited protection against an attacker with these
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Padding schemes only provide limited protection against an attacker with these
: Padding schemes only provide limited protection against an attacker with these

table are attributed to an entity, and only the entity that created a particular
value can extract that value.

To improve compression performance of tqhis option, certain entries might be tagged as being public. For example, a web browser might make the values of the Accept-Encoding header field available in all requests.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To improve compression performance of tqhis option, certain entries might be tagged as being public. For example, a web browser might make the values of the Accept-Encoding header field available in all requests.
To improve compression performance of this option, certain entries might be
tagged as being public. For example, a web browser might make the values of the
Accept-Encoding header field available in all requests.


Note:

Simply removing entries corresponding to the header field from the dynamic table
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Simply removing entries corresponding to the header field from the dynamic table
: Simply removing entries corresponding to the header field from the dynamic table

Comment on lines 1270 to 1272
that a large number of attempts to guess a header field value results in the
header field no more being compared to the dynamic table entries in future
messages, effectively preventing further guesses.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
that a large number of attempts to guess a header field value results in the
header field no more being compared to the dynamic table entries in future
messages, effectively preventing further guesses.
that a large number of attempts to guess a header field value results in the
header field not being compared to the dynamic table entries in future
messages, effectively preventing further guesses.

I had a little trouble with "no more".

Comment on lines 1284 to 1286
field value. Marking a header field as not using the dynamic table any more
might occur for shorter values more quickly or with higher probability than for
longer values.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
field value. Marking a header field as not using the dynamic table any more
might occur for shorter values more quickly or with higher probability than for
longer values.
field value. Disabling access to the dynamic table for a header field might
occur for shorter values more quickly or with higher probability than for longer
values.

Note that these criteria for deciding to use a never indexed literal
representation will evolve over time as new attacks are discovered.

##. Static Huffman Encoding
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
##. Static Huffman Encoding
## Static Huffman Encoding

draft-ietf-quic-qpack.md Show resolved Hide resolved
Comment on lines 1334 to 1335
designed to limit both the peak and state amounts of memory allocated by an
endpoint.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
designed to limit both the peak and state amounts of memory allocated by an
endpoint.
designed to limit both the peak and stable amounts of memory allocated by an
endpoint.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error is in the HPACK RFC. Is it worth an errata?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll let you manage that :) You can be the author of an RFC erratum. The glory!

QPACK through the definition of the maximum size of the dynamic table, and the
maximum number of blocking streams. In HTTP/3, these values are controlled by
the decoder through the setting parameter QPACK_MAX_TABLE_CAPACITY and
QPACK_BLOCKED_STREAMS, respectively (see Section
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
QPACK_BLOCKED_STREAMS, respectively (see Section
QPACK_BLOCKED_STREAMS, respectively (see

HTTP/3, this is realized by setting an appropriate value for the
QPACK_MAX_TABLE_CAPACITY parameter. An encoder can limit the amount of state
memory it uses by signaling lower dynamic table size than the decoder allows
(see {{eviction}}). A decoder can limit the amount of state memory used for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(see {{eviction}}). A decoder can limit the amount of state memory used for
(see {{eviction}}).
A decoder can limit the amount of state memory used for

Copy link
Member

@LPardue LPardue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm modulo some nits

recovered successfully. However, values with low entropy remain vulnerable.

Attacks of this nature are possible any time that two mutually distrustful
entities control requests or responses that are placed onto a single HTTP/2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
entities control requests or responses that are placed onto a single HTTP/2
entities control requests or responses that are placed onto a single HTTP/3

A decoder can limit the amount of state memory used for the dynamic table by
setting an appropriate value for the maximum size of the dynamic table. In
HTTP/3, this is realized by setting an appropriate value for the
QPACK_MAX_TABLE_CAPACITY parameter. An encoder can limit the amount of state
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the doc is inconsistent about QPACK_MAX_TABLE_CAPACITY vs SETTINGS_QPACK_MAX_TABLE_CAPACITY. I don't know what the answer is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text seems to consistently use SETTINGS_ variants, but the table omits it. I'll fix these to match the text, but SETTINGS_ seems redundant in the table. I'll resolve the inconsistency in another PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wfm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an (unstated) norm to omit SETTINGS_ in cases where it's already blatantly obvious that we're discussing a setting. You'll find similar variance in 7540, 7541, and HTTP/3.

setting an appropriate value for the maximum size of the dynamic table. In
HTTP/3, this is realized by setting an appropriate value for the
QPACK_MAX_TABLE_CAPACITY parameter. An encoder can limit the amount of state
memory it uses by signaling lower dynamic table size than the decoder allows
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
memory it uses by signaling lower dynamic table size than the decoder allows
memory it uses by signaling a lower dynamic table size than the decoder allows

(see {{eviction}}). A decoder can limit the amount of state memory used for
blocked streams by setting an appropriate value for the maximum number of
blocked streams. In HTTP/3, this is realized by setting an appropriate value
for the QPACK_BLOCKED_STREAMS parameter. An encoder can limit the amount of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: QPACK_BLOCKED_STREAMS vs. SETTINGS_QPACK_BLOCKED_STREAMS

@martinthomson martinthomson added -qpack editorial An issue that does not affect the design of the protocol; does not require consensus. labels Apr 15, 2020
Copy link
Contributor

@MikeBishop MikeBishop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good (and familiar); some minor nits.

draft-ietf-quic-qpack.md Outdated Show resolved Hide resolved
draft-ietf-quic-qpack.md Outdated Show resolved Hide resolved
draft-ietf-quic-qpack.md Outdated Show resolved Hide resolved
draft-ietf-quic-qpack.md Outdated Show resolved Hide resolved
draft-ietf-quic-qpack.md Outdated Show resolved Hide resolved
An implementation has to set a limit for the values it accepts for integers, as
well as for the encoded length (see {{prefixed-integers}}). In the same way, it
has to set a limit to the length it accepts for string literals (see
{{string-literals}}).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we have a minimum size which MUST be supported; should that be mentioned here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MikeBishop : I can't quite figure an elegant way to mention the minimum here. It is already mentioned in the referenced section.

SETTINGS_QPACK_BLOCKED_STREAMS, respectively (see
{{maximum-dynamic-table-capacity}} and {{blocked-streams}}). The limit on the
size of the dynamic table takes into account both the size of the data stored in
the dynamic table, plus a small allowance for overhead. The limit on the number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"both" does not flow well with "plus". Either s/", plus"/" and"/, or remove "both".

@LPardue
Copy link
Member

LPardue commented Apr 28, 2020

@afrind I think this is inches of getting landed

afrind and others added 2 commits May 5, 2020 15:42
Feedback from Mike

Co-authored-by: Mike Bishop <mbishop@evequefou.be>
@afrind afrind merged commit dcf603b into master May 6, 2020
@afrind afrind deleted the qpack-security branch May 6, 2020 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-qpack editorial An issue that does not affect the design of the protocol; does not require consensus.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QPACK has no Security Considerations
5 participants